package experiment10;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.FontPosture;
import javafx.scene.text.FontWeight;
import javafx.scene.text.Text;
import javafx.stage.Stage;

public class No_3 extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) {
        HBox pane=new HBox();
        Font font=Font.font("Times New Roman", FontWeight.BOLD, FontPosture.ITALIC,22);

        for (int i=0;i<5;i++){
            Text text=new Text("Java");
            text.setFont(font);
            text.setRotate(90);
            text.setFill(new Color(Math.random(),Math.random(),Math.random(),Math.random()));

            pane.getChildren().add(text);
        }

        primaryStage.setTitle("随机文字");
        primaryStage.setScene(new Scene(pane,300,300));
        primaryStage.show();
    }
}
